package com.jinghao.tws.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jinghao.core.common.controller.JingHaoBaseController;
import com.jinghao.tws.entity.WvProcess;
import com.jinghao.tws.entity.WvProduct;
import com.jinghao.tws.service.IWvProductService;

@Controller
@Scope("prototype")
@RequestMapping(value = "/app/tws/WvProduct")
public class WvProductController extends JingHaoBaseController<WvProduct> {
	//==================定制内容开始======================
//在这里修改代码
	
	/**
	 * 更新视频地址信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateWvProductUrlLink",method = RequestMethod.POST) 
	public Map<String, Object> updateWvProductUrlLink(@ModelAttribute("model") WvProduct model,@RequestBody Map<String,Object> map){
		model.setObjMap(map);
		this.getWvProductService().updateWvProductUrlLink(model);
        return model.getJson();   
	}
	
	/**
	 * 收货列表
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/listWvProductBySID",method = RequestMethod.GET) 
	public Map<String, Object> listWvProductBySID(@ModelAttribute("model") WvProduct model){
		this.getWvProductService().listWvProductBySID(model);
        return model.getListJson();   
	}
	
	/**
	 * 事件列表
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/listWvProductByPalletId",method = RequestMethod.GET) 
	public Map<String, Object> listWvProductByPalletId(@ModelAttribute("model") WvProduct model){
		this.getWvProductService().listWvProductByPalletId(model);
        return model.getListJson();   
	}	
	
	/**
	 * 生成短损视频 
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateGenerateVedio",method = RequestMethod.GET) 
	public Map<String, Object> updateGenerateVedio(@ModelAttribute("model") WvProduct model){
		this.getWvProductService().updateGenerateVedio(model);
        return model.getSingleJson();   
	}
	
	/**
	 * 重新生成所有短损视频  
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateReSetAllGenerateVedio",method = RequestMethod.GET) 
	public Map<String, Object> updateReSetAllGenerateVedio(@ModelAttribute("model") WvProduct model){
		this.getWvProductService().updateReSetAllGenerateVedio(model);
        return model.getSingleJson();   
	}
	/**
	 * 停止生成短损视频 
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateStopGenerateVideo",method = RequestMethod.GET) 
	public Map<String, Object> updateStopGenerateVideo(@ModelAttribute("model") WvProduct model){
		this.getWvProductService().updateStopGenerateVideo(model);
        return model.getSingleJson();   
	}
	//==================定制内容结束======================

	@Autowired
	public void setWvProductService(IWvProductService wvProductService) {
		super.setIJingHaoBaseService(wvProductService);
	}

	public IWvProductService getWvProductService() {
		return (IWvProductService) super.getIJingHaoBaseService();
	}
}
